<?php

use Illuminate\Container\Container;
use Illuminate\Support\Fluent;

require __DIR__.'/../vendor/autoload.php';

$app = new Container;
Container::setInstance($app);

with(new \Illuminate\Events\EventServiceProvider($app))->register();
with(new \Illuminate\Routing\RoutingServiceProvider($app))->register();
$manager = new \Illuminate\Database\Capsule\Manager();
$manager->addConnection(require '../config/database.php');
$manager->bootEloquent();
$app->instance('config',new Fluent);
$app['config']['view.compiled']='/Users/zane/works/study/php/lara/storage/framework/views/';
$app['config']['view.paths']=['/Users/zane/works/study/php/lara/resources/views/'];
with(new \Illuminate\View\ViewServiceProvider($app))->register();
with(new \Illuminate\Filesystem\FilesystemServiceProvider($app))->register();


require __DIR__ . '/../app/Http/routes.php';

$request = \Illuminate\Http\Request::createFromGlobals();
$response = $app['router']->dispatch($request);
$response->send();

